package com.homework.ch08;

import java.util.Comparator;
import java.util.Set;
import java.util.TreeSet;

public class Test6 {
    public static void main(String[] args) {
        Set<Integer> set=new TreeSet<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                if(o2%2==0)
                    return -1;
                else{
                    return 1;
                }
            }
        });
        for (int i = 1; i <=10 ; i++) {
            set.add(i);
        }
        System.out.println(set);

    }
}
